import request from '@/utils/request'
import { useTokenStore } from '@/stores/token'
export const articleCategoryListService = () => {
    return request.get('/category')
}

export const addArticleCategoryListService = (categorydata) => {
    return request.post('/category', categorydata)
}

export const editArticleCategoryListService = (categorydata) => {
    return request.put('/category', categorydata)
}

export const deleteArticleCategoryListService = (id) => {
    return request.delete('/category?id=' + id)
}

export const articleListService = (params) => {
    return request.get('/article',{params:params})
}

export const articleAddService =(articleData)=>{
    return request.post('/article',articleData)
}

export const articleUpdateService =(articleData)=>{
    return request.put('/article',articleData)
}

export const deleteArticleService =(id)=>{
    return request.delete('/article?id='+id)
}